package main

import (
    "spider/concurrent/engine"
    "spider/concurrent/parser"
    "spider/concurrent/parser/zhenai"
    "spider/concurrent/scheduler"
)

func main() {
    
    // 普通版
    // engine.SimpleEngine{}.Run(parser.Request{
    //     Url:"http://www.zhenai.com/zhenghun",
    //     Parser:zhenai.CityListParser{},
    // })
    
    // 多任务版 多个worker争抢channel中的任务
    concurrentEngine := &engine.ConcurrentEngine{
        Scheduler:   &scheduler.SimpleScheduler{},
        WorkerCount: 2000,
    }
    
    concurrentEngine.Run(parser.Request{
        Url:    "http://www.zhenai.com/zhenghun",
        Parser: zhenai.CityListParser{},
    })
    
}
